<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>Insert title here</title>
<jsp:include page="/WEB-INF/jsp/common/inc.jsp"></jsp:include>
</head>
<body>


	<input type="file" name="fileName" id="file_upload" />
	<!--  
    <a href="javascript:$('#file_upload').uploadify('upload', '*')">上传文件</a> | <a href="javascript:$('#file_upload').uploadify('stop')">停止上传!</a>
    -->
   	<!--  
    <a href="javascript:$('#file_upload').uploadifive('upload')">上传文件</a> | <a href="javascript:$('#file_upload').uploadifive('stop')">停止上传!</a>
    -->
	<script>
	
	$(document).ready(function() {
		$("#file_upload").uploadifive({
			'buttonText' : '请选择',
			'height' : 30,
			'uploadScript' : 'upload/submit.do',
			//上传文件类型编码，具体可见 http://www.cnblogs.com/anllin/articles/1994485.html
			'fileType' : 'application',
			'width' : 120,
			'auto' : true,//设置选择文件后是否自动上传
			'removeCompleted' : false,
			'fileObjName' : 'file',
			'onUploadComplete' : function(file, data) {
				var data = eval("(" + data + ")");
				if (data.success) {
					alert(data.msg);
				} else {
					alert(data.msg);
				}
			}
		});
	});
	/*
		$(document).ready(function() {
			$("#file_upload").uploadify({
				'buttonText' : '请选择',
				'height' : 30,
				'swf' : 'plugin/jquery-uploadify/uploadify.swf',
				'uploader' : 'upload?method=upload',
				'fileTypeExts' : '*.pdf;*.doc;*.docx',
				'width' : 120,
				'auto' : true,
				'removeCompleted' : false,
				'fileObjName' : 'file',
				'onUploadSuccess' : function(file, data) {
					var data = eval("(" + data + ")");
					if (data.success) {
						alert(data.msg);
					} else {
						alert(data.msg);
					}
				}
			});
		});
	*/
	</script>
</body>
</html>